<template>
    <div class="main">
        <div v-for="(item, index) in productlist" :key="item.id" class="main-list">
            <div class="main-img">
                <!-- <img src="@/assets/images/main-1.png" alt=""> -->
                <img :src="baseUrl + item.image" alt="">
            </div>
            <div class="main-item">
                <div class="main-module-1">
                    <!-- <h4>榴莲+烤鸡+培根+甄选+夏威夷+水果</h4> -->
                    <h4>{{ item.title }}</h4>

                </div>
                <div class="main-module-2">
                    <!-- <b>4.8分</b> -->
                    <b>{{ item.score }}</b>
                    <!-- <span class="sales">月售3565</span> -->
                    <span class="sales">{{ item.monthSales }}</span>
                </div>
                <div class="main-module-3">
                    <span class="send">{{ item.deliveryquota }}</span>
                    <span class="free">{{ item.deliveryfee }}</span>
                </div>
                <div class="main-module-4">
                    <span>{{ item.fullreduction }}</span>
                </div>
            </div>
        </div> 
    </div>
</template>
<script>
import service from "../../api/index";
import {stringBaseURL} from "../../api/urlconfig";
export default {
    data() {
        return { 
            productlist: [],
            baseUrl:stringBaseURL()
        }
    },
    mounted() {
        //页面加载完成 要执行的事儿
        this.productSelectMehtod();
    },
    methods: {

        //获取商品推荐的数据列表
        productSelectMehtod:function()
        {

            service.get("api/PlatformIndex/ProductList").then(reponse=>{

                let { success, data } = reponse.data;  
                if (success) {
                    this.productlist = data;
                }
            });
        }

    }
}

</script>

